/*
 * @Author: hfWang
 * @Date: 2022-07-18 21:01:29
 * @LastEditTime: 2022-09-20 23:29:33
 * @Description: file content
 * @FilePath: \hf-blog-2\docs\.vitepress\customConfig\sidebar.ts
 */

import getFileName from "./getFileName";
import getOtherSeries from "./getOtherSeries";
import type { DefaultTheme } from "vitepress";
import { titleMap } from '../constant'

const generatorSideBarGroup = (type: string) => {
	return [
		{
			text: titleMap[type] || type,
			collapsible: false,
			collapsed: false,
			items: getFileName(type),
		},
		getOtherSeries(type),
	]
}

const sidebar: DefaultTheme.Sidebar = {
	"/vue3/": generatorSideBarGroup('vue3'),
	"/react/": generatorSideBarGroup('react'),
	"/work/": generatorSideBarGroup('work'),
	"/docs/": generatorSideBarGroup('docs'),
	"/source/": generatorSideBarGroup('source'),
	"/interview/": generatorSideBarGroup('interview'),
	"/life/": generatorSideBarGroup('life')
};

export default sidebar;
